<?php

class cAdminMenuModule extends cDycmsClientModule
{
	function __construct()
	{
		global $gClient;
		parent::__construct(uiGetIcon('server_edit').' Administration', array('id'=>'modAdminMenu'));
	}
	
	function DisplayBody()
	{
		$q = new cDycmsQuery();
		$q->AddArray(array('admin-category'=>'*','title'=>'*','icon'=>'*'));
		$n = $q->Execute();
		
		$catz = array(
			'Content' => 'book_open',
			'Users' => 'user',
			'System' => 'server'
		);
		
		foreach ($catz as $cat => $icon) {
			$mods = $q->GetFilteredIndexValues('title', array('admin-category'=>$cat), 'icon');
?>
<div class="navMenu" id="mnuAdminMenu<?php echo $cat; ?>Div">
	<span class="navMenuTitle" id="mnuAdminMenu<?php echo $cat; ?>"><?php uiIcon($icon); ?> <?php echo $cat; ?></span>
	<ul class="navMenuBody" id="mnuAdminMenu<?php echo $cat; ?>">
<?php
			if (is_array($mods)) foreach($mods as $mod => $modIcon) { ?>
		<li><a href="<?php echo dyBrowserUrl(array('title'=>$mod,'admin-category'=>$cat)); ?>"><?php uiIcon($modIcon); echo $mod; ?></a></li><?php
			}; ?>
	</ul>
</div>
<?php
		}
	}
}